package com.circle.rest.modular.sys.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.circle.rest.modular.sys.dao.RelationMapper;
import com.circle.rest.modular.sys.model.Relation;
import com.circle.rest.modular.sys.service.IRelationService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色和菜单关联表 服务实现类
 * </p>
 *
 * @author 赵航
 * @since 2019-04-02
 */
@Service
public class RelationServiceImpl extends ServiceImpl<RelationMapper, Relation> implements IRelationService {

    /**
     * 校验角色权限
     *
     * @param roleid
     * @param url
     * @return
     */
    @Override
    public boolean checkPermission(String roleid, String url) {
        List<Relation> relations = this.baseMapper.checkPermission(roleid, url);
        if (relations.size() > 0) {
            return true;
        }
        return false;
    }
}
